Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Unwrap a one-liner #301

Merged
merged 1 commit into from
Oct 5, 2024
Merged

refactor: Unwrap a one-liner #301

merged 1 commit into from
Oct 5, 2024

Conversation

shpaass
Copy link
Owner

@shpaass shpaass commented Sep 20, 2024

The idea was to make this part of code more readable. For this, the following steps were taken:

  1. Split booleans into one equality or expression per boolean.
  2. Explain with local names what the booleans check.
  3. Put on-select actions as a local function too.
  4. Align parameters Google-style.

I also added blank lines around some code blocks.

QA: tested on a pY project that the corresponding window selects and deselects things as usual.

This ticket is a part of #256. It doesn't fix it, but it works towards addressing it.

@shpaass shpaass changed the title refactor: unwrap a one-liner refactor: Unwrap a one-liner Sep 25, 2024
@shpaass
Copy link
Owner Author

shpaass commented Oct 3, 2024

Rebased on fresh master and changed a function name onSelect.

Copy link

@skullbearer skullbearer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I confirmed that SelectSingleObjectPanel.Select() accepts an Action for the third parameter, which was the only thing that gave me pause.

Functionally identical to my check to the original, but far more readable.

The idea was to make this part of code more readable.
For this, the following steps were taken:
1. Split booleans into one equality or expression per boolean.
2. Explain with local names what the boolean conditions check.
3. Put on-select actions as a local function too.
4. Align parameters Google-style.

QA: tested on a pY project that the corresponding window selects
and deselects things as usual.
@shpaass
Copy link
Owner Author

shpaass commented Oct 5, 2024

Rebased on fresh master

@shpaass shpaass merged commit 4b5085e into master Oct 5, 2024
1 check passed
@shpaass shpaass deleted the unwrap-oneliner branch October 5, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants